package com.game.majiang.algorithm.chexuan;

import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.UnsupportedEncodingException;
import java.util.ArrayList;

import com.game.majiang.algorithm.niuniu.card;




public class TestDeal {
 
	   public static ArrayList<card>[]  Deal() throws UnsupportedEncodingException, FileNotFoundException
	   {
	  InputStreamReader r = null;
		try {
			r = new InputStreamReader(new FileInputStream("config//test.txt"), "UTF-8");
		} catch (FileNotFoundException e) {
			throw e;
		}
       catch (UnsupportedEncodingException e) {
    	   throw e;
		}
		BufferedReader  reader = new BufferedReader(r);
		String str1 = null,str2 = null,str3 = null,str4 = null,str5 = null,str6 = null,str7 = null;
		try {
		       	str1 =  reader.readLine();
		        str2 =  reader.readLine();
		        str3 =  reader.readLine();
		        str4 =  reader.readLine();
		        str5 =  reader.readLine();
		        str6 =  reader.readLine();
		        str7 =  reader.readLine();
		} catch (IOException e) {
			e.printStackTrace();
		}
		ArrayList<card> array[] = new ArrayList[6];
		String[] ss = str1.split(",");
		array[0] = new ArrayList<card>(17);
	    for(String s:ss)
	    {
	    	array[0].add(new card(Integer.parseInt(s)));
	    }
	    ss = str2.split(",");
	    array[1] = new ArrayList<card>(17);
	    for(String s:ss)
	    {
	    	array[1].add(new card(Integer.parseInt(s)));
	    }
	    ss = str3.split(",");
	    array[2] = new ArrayList<card>(17);
	    for(String s:ss)
	    {
	    	array[2].add(new card(Integer.parseInt(s)));
	    }
	    ss = str4.split(",");
    	array[3] = new ArrayList<card>(17);
	    for(String s:ss)
	    {
	    	array[3].add(new card(Integer.parseInt(s)));
	    }
	    ss = str5.split(",");
    	array[4] = new ArrayList<card>(17);
	    for(String s:ss)
	    {
	    	array[4].add(new card(Integer.parseInt(s)));
	    }
	    ss = str6.split(",");
    	array[5] = new ArrayList<card>(17);
	    for(String s:ss)
	    {
	    	array[5].add(new card(Integer.parseInt(s)));
	    }
	    ss = str7.split(",");
    
	    return array;
	   }
}
